package wzh.crm.ui.opportunity;

import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.view.View;

import wzh.crm.bl.BL;
import wzh.crm.ui.DisplayListItemView;
import wzh.crm.vo.OpportunityVo;

/**
 * Created by wangzehao on 2016/5/23.
 */
public class OpportunityListItem extends DisplayListItemView<OpportunityVo> {
    public OpportunityListItem(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void setModel(final OpportunityVo model) {
        setTitle(model.get商机标题());
        setDetail(BL.opportunityBL().getDetailInBackground(model));

        this.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i=new Intent(getContext(),OpportunityOverviewActivity.class);
                i.putExtra("MODEL",model);
                getContext().startActivity(i);
            }
        });
    }
}
